/*
 * @Author: your name
 * @Date: 2021-07-31 10:26:42
 * @LastEditTime: 2021-07-31 10:31:04
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \hrsaas\src\mixin\checkPermission.js
 */
import store from '@/store'

export default {
  methods: {

    // 检查权限
    checkPermission(key) {
      // 找用户的信息中的points中有没有key 则认为有权限  如果没有key则人不能点击
      const { userInfo } = store.state.user
      console.log(userInfo)
      if (userInfo.roles && userInfo.roles.points) {
        return userInfo.roles.points.some(item => item === key)
      }

      // 没进去 说明没权限
      return false
    }
  }
}
